package com.huawei.appmarket.service.store.awk.card;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appgallery.horizontalcard.api.card.BaseHorizontalItemCard;
import com.huawei.appmarket.service.store.awk.bean.HorizontalHotTopicItemBean;
import com.huawei.appmarket.support.video.VideoPlayer;
import o.cgz;
import o.chc;
import o.chy;
import o.ckt;
import o.dof;
import o.epv;
import o.eqx;
import o.evp.b;
import o.evt;
import o.ewm.h;
import o.ewm.j;
import o.ewm.n;

public class HorizontalHotTopicItemCard extends BaseHorizontalItemCard {
    private LinearLayout ʻ;
    private TextView ʼ;
    private VideoPlayer ˋ;
    private TextView ᐝ;

    public HorizontalHotTopicItemCard(Context context) {
        super(context);
    }

    private static int ॱॱ() {
        return chc.ᐝॱ();
    }

    public cgz ˏ(View view) {
        this.ˋ = (VideoPlayer) view.findViewById(j.ˈꓸ);
        this.ʼ = (TextView) view.findViewById(j.ˈʿ);
        this.ᐝ = (TextView) view.findViewById(j.ʿʾ);
        this.ʻ = (LinearLayout) view.findViewById(j.ᐝʼ);
        ʽ(view);
        ʻ();
        return this;
    }

    private void ʻ() {
        int ˎ = epv.ˎ(this.ʼॱ, ॱॱ(), chc.ˋ());
        this.ˋ.setLayoutParams(new LayoutParams(ˎ, (int) (((float) ˎ) * epv.ʼ())));
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        if (cardBean instanceof HorizontalHotTopicItemBean) {
            HorizontalHotTopicItemBean horizontalHotTopicItemBean = (HorizontalHotTopicItemBean) cardBean;
            this.ʼ.setText(horizontalHotTopicItemBean.ʻˋ());
            this.ᐝ.setText(horizontalHotTopicItemBean.ʻˊ());
            int i = j.ʿˌ;
            int i2 = j.ʿˑ;
            String str = (String) this.ʻ.getTag(i);
            String str2 = (String) this.ʻ.getTag(i2);
            if (!dof.ˋ(str) && str.equals(horizontalHotTopicItemBean.ʻᐝ())) {
                return;
            }
            if (dof.ˋ(str2) || !str2.equals(horizontalHotTopicItemBean.ʼˋ())) {
                str = horizontalHotTopicItemBean.ʼˋ();
                Object ʻᐝ = horizontalHotTopicItemBean.ʻᐝ();
                this.ʻ.setTag(i, ʻᐝ);
                this.ʻ.setTag(i2, str);
                if (this.ˋ != null) {
                    if (TextUtils.isEmpty(ʻᐝ)) {
                        this.ˋ.setTag(null);
                    } else {
                        this.ˋ.setTag(this.ˋ.getContext().getString(n.ʽʾ));
                    }
                    this.ˋ.setVideoBaseInfo(new b().ˎ(horizontalHotTopicItemBean.ʼˊ()).ˊ(str).ˋ(ʻᐝ).ˏ(horizontalHotTopicItemBean.ͺˏ()).ʼ(horizontalHotTopicItemBean.ʾॱ()).ॱ(horizontalHotTopicItemBean.u_()).ᐝ(horizontalHotTopicItemBean.ʽᐝ()).ʻ(evt.ˏ(horizontalHotTopicItemBean.sp_)).ॱॱ(horizontalHotTopicItemBean.ॱـ()).ॱ());
                    eqx.ˏ(this.ˋ.ॱॱ(), str, "image_default_icon");
                }
            }
        }
    }

    public int ˊ() {
        return h.ʼˋ;
    }

    public int ˎ() {
        return h.ʼˋ;
    }

    public void ॱ(final chy o_chy) {
        OnClickListener o_ckt = new ckt(new OnClickListener(this) {
            final /* synthetic */ HorizontalHotTopicItemCard ॱ;

            public void onClick(View view) {
                o_chy.ˏ(0, this.ॱ);
            }
        });
        this.ˋ.ॱॱ().setOnClickListener(o_ckt);
        ˉ().setOnClickListener(o_ckt);
    }
}
